package com.class05.method_more._03valuetransfer;


import com.sun.org.apache.bcel.internal.generic.NEW;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/3/26 11:34
 */
public class ValueTransferTest2 {

    public static void main(String[] args) {
        int m = 10;
        int n = 20;
//        交换两个变量得值
//        操作一：
//        int temp = m;
//        m = n;
//        n = temp;
        ValueTransferTest2 test2 = new ValueTransferTest2();
        //        操作2：
        test2.swap(m,n);



    }

    public void swap(int m, int n) {
        int temp = m;
        m = n;
        n = temp;
        System.out.println("m = " + m);
    }
}
